<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org/">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <base th:href="${#servletContext.getContextPath()+'/'}">

</head>
<body>

<div th:fragment="pageDiv">

    <link rel="stylesheet" href="lib/layer/ui/css/layui.css" media="all">
    <script src="lib/layer/ui/layui.js"></script>

    <div id="pageDemo"></div>

    <script th:inline="javascript">
        var count = [[${page.total}]];
        var curr = [[${page.current}]];
        var limit = [[${page.size}]];
        var url =[[${url}]];
    </script>

    <script type="text/javascript">
        layui.use('laypage', function(){
            // 分页对象
            var laypage = layui.laypage;

            //完整功能
            laypage.render({
                elem: 'pageDemo'
                ,count: count
                ,curr: curr
                ,limit:limit
                ,limits:[5,10,20,30]
                ,layout: ['prev', 'page', 'next', 'limit', 'refresh', 'skip','count']
                ,jump: function(obj,first){
                    if(!first){
                        // 进行下一页的查询
                        location.href=url+"?current="+obj.curr+"&size="+obj.limit;
                    }
                }
            });
        });
    </script>

</div>

</body>
</html>